Flow-based sleep stage determination

ABSTRACT

A method and system of determining a sleep stage of a user involves receiving a respiratory flow signal of a user, obtaining at least one respiratory feature from at least part of the respiratory flow signal, and determining a sleep stage from the at least one respiratory feature.

FIELD OF THE INVENTION

The invention relates to a method and system for sleep stagedetermination. More particularly the invention relates to sleep stagedetermination based at least partly on respiratory signal.

BACKGROUND OF THE INVENTION

Devices or systems for providing a humidified gases flow to a user fortherapeutic purposes are well known in the art. Such devices aretypically configured to detect Sleep Disordered Breathing (SDB) events.Such devices are not usually configured to obtain more detailedinformation about a user's sleep patterns. One example is thedetermination of sleep stage of a user.

Sleep stage is determined by the analysis of bio-signals including atleast (electroencephalogram (eeg), electromyogram (emg), andelectro-oculogram (eog). The definition of sleep stages is based on thecharacteristics of the bio-signals.

At the present time, the most accepted method to determine sleep stagesrequires the interaction from experienced sleep technicians, whichanalyses several traces of signals (PSG study).

It is an object of at least preferred embodiments of the presentinvention to address some of the aforementioned disadvantages. Anadditional or alternative object is to at least provide the public witha useful choice.

SUMMARY OF THE INVENTION

In one aspect a method of determining a sleep stage of a user comprisesreceiving a respiratory flow signal of a user; obtaining at least onerespiratory feature from at least part of the respiratory flow signal;and determining a sleep stage from the at least one respiratory feature.

The term ‘comprising’ as used in this specification means ‘consisting atleast in part of’. When interpreting each statement in thisspecification that includes the term ‘comprising’, features other thanthat or those prefaced by the term may also be present. Related termssuch as ‘comprise’ and ‘comprises’ are to be interpreted in the samemanner.

Preferably the at least one respiratory feature is based at least partlyon at least one duration measurement.

Preferably the at least one duration measurement includes one or more ofbreath duration, inspiration duration, maximum inspiration time, maximumexpiration time, a function of maximum expiration time and maximuminspiration time, a function of inspiration duration and breathduration.

Preferably the at least one respiratory feature is based at least partlyon at least one amplitude measurement.

Preferably the at least one amplitude measurement includes one or moreof maximum inspiration amplitude, maximum expiration amplitude, afunction of maximum inspiration amplitude and maximum expirationamplitude.

Preferably the at least one respiratory feature is based at least partlyon at least one centre of mass related measurement.

Preferably the at least one centre of mass related measurement includesone or more of inspiration centre of mass time, inspiration centre ofmass amplitude, expiration centre of mass time, expiration centre ofmass amplitude, a function of expiration centre of mass time andinspiration centre of mass time, a function of expiration centre of massamplitude and inspiration centre of mass amplitude.

Preferably the at least one respiratory feature is based at least partlyon at least one derivative related measurement.

Preferably the at least one derivative related measurement includes oneor more of maximum negative acceleration time, maximum negativeacceleration amplitude, maximum positive acceleration time, maximumpositive acceleration amplitude, maximum negative flow rate time,maximum negative flow rate amplitude, maximum inspiration accelerationtime, maximum inspiration acceleration amplitude.

Preferably the at least one respiratory feature is based at least partlyon at least one volume related measurement.

Preferably the at least one volume related measurement includes one ormore of inspiration volume, expiration volume, a function of inspirationvolume and expiration volume.

Preferably the method further comprises identifying, within therespiratory flow signal, at least one breath signal representing abreath of the user; and obtaining at least one breath measurement from aportion of the respiratory flow signal within which the at least onebreath signal is identified.

Preferably the method further comprises identifying, within therespiratory flow signal, a window containing a plurality of breathsignals; and obtaining respective breath measurements of the breathsignals within the window.

Preferably the at least one breath feature comprises a mean and/orstandard deviation of the breath measurements within at least part ofthe window.

Preferably the method further comprises determining a sleep stage fromthe at least one breath feature at least partly by applying at least oneof a supervised learning algorithm, an unsupervised learning algorithm,a semi-supervised learning algorithm.

Preferably the at least one supervised learning algorithm comprises oneor more of linear and logistic regression, support vector machine,artificial neural network, decision tree.

Preferably the sleep stage comprises one of awake, N1, N2, N3, REM.

Preferably the sleep stage comprises one of awake, light sleep, deepsleep, REM.

Preferably the sleep stage comprises one of awake, non-REM, REM.

Preferably the sleep stage comprises one of awake, sleep.

Preferably the method further comprises applying a filter to therespiratory flow signal to remove at least one of high frequency noise,DC level.

In another aspect, a sleep determination system comprises a featureextractor configured to obtain at least one respiratory feature from atleast part of a respiratory flow signal of a user; and a mapping moduleconfigured to determine a sleep stage from the at least one respiratoryfeature.

In another aspect, a sleep determination system comprises a processor;and a computer readable medium having stored thereon computer executableinstructions that, when executed by the processor, cause the processorto perform a method of determining a sleep stage of a user. The methodcomprises receiving a respiratory flow signal of a user; obtaining atleast one respiratory feature from at least part of the respiratory flowsignal; and determining a sleep stage from the at least one respiratoryfeature.

In another aspect, a computer readable medium has stored thereoncomputer-executable instructions that, when executed by a processor,cause the processor to perform a method of determining a sleep stage ofa user. The method comprises receiving a respiratory flow signal of auser; obtaining at least one respiratory feature from at least part ofthe respiratory flow signal; and determining a sleep stage from the atleast one respiratory feature.

The invention in one aspect comprises several steps. The relation of oneor more of such steps with respect to each of the others, the apparatusembodying features of construction, and combinations of elements andarrangement of parts that are adapted to affect such steps, are allexemplified in the following detailed disclosure.

To those skilled in the art to which the invention relates, many changesin construction and widely differing embodiments and applications of theinvention will suggest themselves without departing from the scope ofthe invention as defined in the appended claims. The disclosures and thedescriptions herein are purely illustrative and are not intended to bein any sense limiting. Where specific integers are mentioned hereinwhich have known equivalents in the art to which this invention relates,such known equivalents are deemed to be incorporated herein as ifindividually set forth.

As used herein, ‘(s)’ following a noun means the plural and/or singularforms of the noun.

As used herein, the term ‘and/or’ means ‘and’ or ‘or’ or both.

It is intended that reference to a range of numbers disclosed herein(for example, 1 to 10) also incorporates reference to all rationalnumbers within that range (for example, 1, 1.1, 2, 3, 3.9, 4, 5, 6, 6.5,7, 8, 9, and 10) and also any range of rational numbers within thatrange (for example, 2 to 8, 1.5 to 5.5, and 3.1 to 4.7) and, therefore,all sub-ranges of all ranges expressly disclosed herein are herebyexpressly disclosed. These are only examples of what is specificallyintended and all possible combinations of numerical values between thelowest value and the highest value enumerated are to be considered to beexpressly stated in this application in a similar manner.

In this specification where reference has been made to patentspecifications, other external documents, or other sources ofinformation, this is generally for the purpose of providing a contextfor discussing the features of the invention. Unless specifically statedotherwise, reference to such external documents or such sources ofinformation is not to be construed as an admission that such documentsor such sources of information, in any jurisdiction, are prior art orform part of the common general knowledge in the art.

Although the present invention is broadly as defined above, thosepersons skilled in the art will appreciate that the invention is notlimited thereto and that the invention also includes embodiments ofwhich the following description gives examples.

The term ‘connected to’ as used in this specification in relation todata or signal transfer includes all direct or indirect types ofcommunication, including wired and wireless, via a cellular network, viaa data bus, or any other computer structure. It is envisaged that theymay be intervening elements between the connected integers. Variantssuch as ‘in communication with’, ‘joined to’, and ‘attached to’ are tobe interpreted in a similar manner. Related terms such as ‘connecting’and ‘in connection with’ are to be interpreted in the same manner.

The term ‘computer-readable medium’ should be taken to include a singlemedium or multiple media. Examples of multiple media include acentralised or distributed database and/or associated caches. Thesemultiple media store the one or more sets of computer executableinstructions. The term ‘computer readable medium’ should also be takento include any medium that is capable of storing, encoding or carrying aset of instructions for execution by a processor and that cause theprocessor to perform any one or more of the methods described above. Thecomputer-readable medium is also capable of storing, encoding orcarrying data structures used by or associated with these sets ofinstructions. The term ‘computer-readable medium’ includes solid-statememories, optical media and magnetic media.

BRIEF DESCRIPTION OF THE DRAWINGS

Preferred forms of the method and system for sleep stage determinationwill now be described by way of example only with reference to theaccompanying figures in which:

FIG. 1 is a perspective view of a Continuous Positive Airway Pressure(CPAP) machine configured to obtain a respiratory flow signal from auser;

FIG. 2 shows a schematic view of the CPAP machine of FIG. 1;

FIG. 3 shows a schematic view of a sleep stage determination module;

FIG. 4 shows an example of a method performed by the sleep stagedetermination module of FIG. 3;

FIG. 5 shows examples of duration measurements and amplitudemeasurements from which the feature extractor of FIG. 3 obtainsrespiratory feature(s).

FIG. 6 shows examples of centre of mass measurements from which thefeature extractor obtains respiratory feature(s).

FIG. 7 shows examples of derivative related measurements from which thefeature extractor obtains respiratory feature(s).

FIG. 8 shows examples of volume related measurements from which thefeature extractor obtains respiratory feature(s).

FIG. 9 shows an example of the feature extractor obtaining respiratoryfeature(s) from window(s) comprising multiple breath signals.

FIG. 10 shows an example of agreement between the mapping module of FIG.3 and the inferred sleep stages of a test study.

FIG. 11 shows an example function of the context module from FIG. 3applying contextual clues in an attempt to improve accuracy of theperformance of the mapping module.

FIG. 12 shows the accuracy per patient of a test study.

FIG. 13 shows an example of typical performance for an individualpatient.

FIG. 14 shows an example of a computing system and/or device thatimplements the sleep stage determination module of FIG. 3.

DETAILED DESCRIPTION

FIG. 1 shows a user 100 receiving air from a modular assisted breathingunit and humidifier system 102. System 102 is shown in FIG. 1 as aContinuous Positive Airway Pressure (CPAP) machine. In an embodiment thesystem 102 provides a pressurised stream of heated, humidified gases tothe user 100 for therapeutic purposes. These therapeutic purposesinclude for example one or more of reducing the incidence of obstructivesleep apnea, providing CPAP therapy, providing humidification fortherapeutic purposes.

A heated and humidified gases stream passes along the length of adelivery conduit 104 and are provided to the user 100 via a userinterface 106. In an embodiment the conduit 104 is heated via a heaterwire (not shown) or similar to help prevent rain-out.

The conduit 104 typically has a circular internal cross-section. Theinternal diameter of the conduit is typically about 20 mm. in anembodiment the internal diameter is between 10 mm and 30 mm. Thesetypical dimensions apply to both flexible portions of the gases flowpassageway and rigid components such as elbows and connectors andportions integrated into components of the humidified gases supply.

In an embodiment the user interface 106 comprises a full face mask. Itwill be appreciated that alternatives to a full face mask include anasal mask that surrounds and covers the nose of the user 100, nasalcannula, tracheostomy fitting, any other suitable user interface.

FIG. 2 shows a schematic view of system 100 of FIG. 1. The system 100includes an air supply 200 configured to deliver the heated andhumidified gases stream into the delivery conduit 104.

In an embodiment the air supply 200 includes a flow control mechanismthat in turn includes for example an internal compressor unit and a flowgenerator or fan unit 202. Air from the atmosphere enters the housing ofthe air supply 200 via an atmospheric inlet (not shown) and is drawnthrough the fan unit 202. In an embodiment the output of the fan unit202 is adjustable by varying the speed of the fan.

In an embodiment the air supply 200 includes or is interfaced to ahumidifier chamber (not shown). The humidifier chamber contains a volumeof water. A heater plate heats the base of the humidifier chamberthereby heating the contents of the chamber. As the water in the chamberis heated it evaporates and the gases within the humidifier chamberbecome heated and humidified. The gases stream entering the humidifierchamber passes over the heated water and becomes heated and humidifiedas it does so.

As described above the heated and humidified gases stream enters thedelivery conduit 104.

A central controller 204 or control system is connected to a memory 206.The controller 204 receives user input signals via user input 208 anddisplays output to a user via display 210. In an embodiment thecontroller 204 receives input from at least one sensor 212 located atvarious points within system 102, conduit 104 and/or interface 106. Inresponse to the input from user input 208 and sensor(s) 212 thecontroller 204 determines a control output that sends signals to adjustthe power to the air supply 202.

In an embodiment the sensor(s) 212 receive signals representative ofinspiration and expiration of the user 100. The sensor(s) 212 sends arespiratory flow signal to the controller 204.

FIG. 3 shows a schematic view of a sleep stage determination module 300.The module 300 receives a respiratory flow signal 302. An example of arespiratory flow signal is one sent from the sensor(s) 212 to thecontroller 204.

In an embodiment a filter 304 pre-processes the respiratory flow signalto remove high frequency noise and DC level. The use of the filter 304is optional. In an embodiment the filter 304 is not present or therespiratory flow signal 302 is not sent to the filter 304.

In an embodiment a flow segmenter 306 segments the respiratory flowsignal into time-based epochs and/or breath-number-based epochs forsubsequent feature extraction as will be further described below. Theuse of the flow segmenter 306 is optional. In an embodiment featureextraction is performed on the raw respiratory flow signal 302.

In an embodiment a flow segment measurement module 308 determinesmeasurements of the respiratory flow signal 302 on which featureextraction is subsequently based as will be described below. In anembodiment the measurement module 308 determines one or more of durationmeasurements, amplitude measurements, centre of mass relatedmeasurements, derivative related measurements, volume relatedmeasurements.

In an embodiment a feature extractor 310 obtains at least onerespiratory feature from the respiratory flow signal 302. As describedabove the feature extractor takes as input one or more of a filteredrespiratory flow signal, a segmented respiratory flow signal in whichbreath segmentation has been performed, an otherwise unprocessedrespiratory flow signal.

In an embodiment a mapping module 312 maps a set of respiratory featuresto at least one sleep stage as will be further described below. Acontext module 314 optionally applies context data in an attempt toimprove the accuracy of the mapping module 312 output.

The module 300 outputs a sleep stage 316 determined by the mappingmodule 312 and optionally context module 314 from the respiratory flowsignal 302. In an embodiment the module determines a sequence of and/ormultiple sleep stages 316 from a respiratory flow signal 302.

In an embodiment the module 300 is implemented within the modularassisted breathing unit and humidifier system 102. The module outputsthe sleep stage 316 on the display 210 and/or stores the sleep stage onthe memory 206.

In an embodiment the module 300 is implemented on a computing device forexample the computing device 1400 of FIG. 14. The sleep stage 316 ispresented on a display and/or maintained on a memory that either form(s)part of the computing device 1400 or is/are connected to computingdevice 1400.

FIG. 4 shows an example of a method 400 performed by the sleep stagedetermination module 300 of FIG. 3. In an embodiment, the module 300receives 402 a respiratory flow signal. Filtering (not shown) isoptionally performed on the respiratory flow signal to remove highfrequency noise and DC level.

In an embodiment the flow segmenter 306 of FIG. 3 optionally applies 404flow segmentation to the respiratory flow signal. As described above,the flow segmenter segments the respiratory flow signal into time-basedepochs and/or breath-number-based epochs for subsequent featureextraction.

In an embodiment the measurement module 308 obtains 406 flow segmentmeasurements of the respiratory flow signal on which feature extractionis subsequently based. Examples of measurements include one or more ofduration measurements, amplitude measurements, centre of mass relatedmeasurements, derivative related measurements, volume relatedmeasurements. In an embodiment these measurements comprise breathmeasurements.

In an embodiment the feature extractor 310 performs 408 featureextraction on flow segment measurements. For example, the featureextractor 310 obtains at least one respiratory feature from therespiratory flow signal.

The module 300 determines 410 a sleep stage, a sequence of sleep stages,and/or multiple sleep stages from the features extracted from therespiratory flow signal. In an embodiment this function is performed bythe mapping module 312 and optionally also the context module 314.

In an embodiment, the feature extractor obtains at least one respiratoryfeature based at least partly on at least one duration measurement. FIG.5 shows examples of duration measurements associated to a maximuminspiration 500 and a maximum expiration 502.

In an embodiment, the duration measurements include one or more of:

-   -   breath duration    -   inspiration duration    -   maximum inspiration time    -   maximum expiration time

In an embodiment, the duration measurements include a function of two ormore duration measurements. Examples of functions include:

-   -   a difference between maximum expiration time and maximum        inspiration time    -   a ratio of inspiration duration to breath duration.

In an embodiment, the feature extractor obtains at least one respiratoryfeature based at least partly on at least one amplitude measurement.FIG. 5 also shows examples of amplitude measurements.

In an embodiment, the amplitude measurements include one or more of:

-   -   maximum inspiration amplitude    -   maximum expiration amplitude.

In an embodiment, the amplitude measurements include a function of twoor more amplitude measurements. An example of a function is a differencebetween maximum inspiration amplitude and maximum expiration amplitude.

In an embodiment the duration and/or amplitude measurements are obtainedfrom a single breath. In an embodiment the duration and/or amplitudemeasurements are calculated as a mean or average of at least twobreaths. In an embodiment the at least two breaths are consecutive.

In an embodiment, the feature extractor obtains at least one respiratoryfeature based at least partly on at least one centre of massmeasurement. FIG. 6 shows examples of centre of mass measurements.

In an embodiment, the centre of mass measurement includes inspirationcentre of mass time. The centre of mass of the body formed by theinspiration curve is indicated at 600. A time axis component of theinspiration centre of mass 600 is calculated for example relative to thebeginning of the breath by the following:

$\mspace{20mu} {{x\text{?}} = \frac{\text{?}{\left( {y_{i}\left( {x_{i} - {x\text{?}}} \right)} \right)}x_{i}}{\text{?}{\left( {y_{i}\left( {x_{i} - {x\text{?}}} \right)} \right)}}}$?indicates text missing or illegible when filed

where N_(Insp) is the number of inspiration points i in the curve, y_(i)and x_(i) are the signal amplitudes and time, respectively.

In an embodiment, the centre of mass measurement includes expirationcentre of mass time. The centre of mass of the body formed by theinspiration curve is indicated at 602. A time axis component of theexpiration centre of mass 602 is calculated for example relative to thebeginning of the breath by the following:

$\mspace{20mu} {{x\text{?}} = \frac{\text{?}{\left( {y_{i}\left( {x_{i} - {x\text{?}}} \right)} \right)}x_{i}}{\text{?}{\left( {y_{i}\left( {x_{i} - {x\text{?}}} \right)} \right)}}}$?indicates text missing or illegible when filed

where N_(Exp) is the number of expiration points i in the curve, y_(i)and x_(i) are the signal amplitude and time respectively.

In an embodiment, the centre of mass measurement includes a function ofexpiration centre of mass time and inspiration centre of mass time. Anexample is the difference between expiration centre of mass time andinspiration centre of mass time.

In an embodiment, the centre of mass measurement includes inspirationcentre of mass amplitude. An amplitude axis component of the inspirationcentre of mass 600 is calculated for example relative to the inspirationcurve and the baseline by the following:

$\mspace{20mu} {\text{?} = \frac{\text{?}{\left( {y_{i}\left( {x_{i} - {x\text{?}}} \right)} \right)}y_{i}}{2\text{?}{\left( {y_{i}\left( {x_{i} - {x\text{?}}} \right)} \right)}}}$?indicates text missing or illegible when filed

where N_(Insp) is the number of inspiration points i in the curve, y_(i)and x_(i) are the signal amplitude and time, respectively.

In an embodiment, the centre of mass measurement includes expirationcentre of mass amplitude. An amplitude axis component of the expirationcentre of mass 602 is calculated for example relative to the expirationcurve and the baseline by the following:

$\mspace{20mu} {{y\text{?}} = \frac{\text{?}{\left( {y_{i}\left( {x_{i} - {x\text{?}}} \right)} \right)}y_{i}}{2\text{?}\; {\left( {y_{i}\left( {x_{i} - {x\text{?}}} \right)} \right)}}}$?indicates text missing or illegible when filed

where N_(Exp) is the number of expiration points i in the curve, y_(i)and x_(i) are the signal amplitude and time, respectively.

In an embodiment, the centre of mass measurement includes a function ofexpiration centre of mass amplitude and inspiration centre of massamplitude. An example is the difference between expiration centre ofmass amplitude and inspiration centre of mass amplitude.

In an embodiment, the feature extractor obtains at least one respiratoryfeature based at least partly on at least one derivative relatedmeasurement. FIG. 7 shows examples of derivative related measurements.

In an embodiment, the derivative related measurement includes a maximumnegative acceleration time. FIG. 7 shows a maximum inspiration 700 and amaximum expiration 702. A maximum negative acceleration 704 has a timevalue between the time of maximum inspiration 700 and the time ofmaximum expiration 702. The time value of 704 is a time when theacceleration reaches a negative peak, calculated from the beginning ofthe breath. In an embodiment the time value is computed with the secondderivative obtained from a Savitzky Golay filter.

In an embodiment, the derivative related measurement includes a maximumpositive acceleration time, having a time value between the time ofmaximum inspiration 700 and the time of maximum expiration 702. The timevalue of 706 is a time when the acceleration reaches a positive peak,calculated from the beginning of the breath. In an embodiment the timevalue of 706 is computed with the second derivative obtained from aSavitzky Golay filter.

In an embodiment, the derivative related measurement includes a timevalue for a maximum inspiration acceleration 710. A time value formaximum inspiration acceleration 710 is a time value between the startof the breath and maximum inspiration 700 when the acceleration is at amaximum. In an embodiment the time value is computed with the secondderivative obtained from a Savitzky Golay filter.

In an embodiment the derivative related measurement includes a functionof a maximum negative acceleration time and a maximum positiveacceleration time. An example is a maximum negative flow rate time 708comprising a time between maximum negative acceleration and maximumpositive acceleration when the acceleration is zero, calculated from thebeginning of the breath. In an embodiment this is computed by finding afirst zero crossing position on a second derivative signal generated bya Savitsky Golay filter.

In an embodiment, the derivative related measurement includes a maximumnegative acceleration amplitude. The amplitude of the maximum negativeacceleration 704 occurs between a time of maximum inspiration 700 and atime of maximum expiration 702. In an embodiment the amplitude ofmaximum negative acceleration 704 is computed with the second derivativeobtained from a Savitzky Golay filter.

In an embodiment, the derivative related measurement includes a maximumpositive acceleration amplitude. The amplitude of the maximum positiveacceleration 706 occurs between a time of maximum negative acceleration704 and the end of the breath. In an embodiment the amplitude of maximumpositive acceleration 706 is computed with the second derivativeobtained from a Savitzky Golay filter.

In an embodiment, the derivative related measurement includes anamplitude for the maximum inspiration acceleration 710. The amplitudeoccurs between the start of the breath and maximum inspiration 700. Inan embodiment the amplitude is computed with the second derivativeobtained from a Savitzky Golay filter.

In an embodiment the derivative related measurement includes a functionof a maximum negative acceleration time and a maximum positiveacceleration time. An example is an amplitude of maximum negative flowrate 708 comprising an amplitude of a maximum rate of change in the flowsignal that occurs between maximum negative acceleration and maximumpositive acceleration. In an embodiment the amplitude is approximated bycalculating the difference in flow at the point when the acceleration iszero.

In an embodiment, the feature extractor obtains at least one respiratoryfeature based at least partly on at least one volume relatedmeasurement. FIG. 8 shows examples of volume related measurements.

In an embodiment, the volume related measurement includes inspirationvolume 800 comprising the volume of the inspiration part of the flowsignal above the baseline. The inspiration volume 800 is calculated forexample by the following:

$\mspace{20mu} {V_{Insp} = \frac{\text{?}\; \left( {y_{i} - B} \right)}{SR}}$?indicates text missing or illegible when filed

where N_(Insp) is the number of inspiration points i in the curve, y_(i)and B are the signal amplitude and the baseline, respectively. SR is thesampling rate of the signal in samples per minute.

In an embodiment, the volume related measurement includes expirationvolume 802 comprising the volume of the inspiration part of the flowsignal above the baseline. The expiration volume 802 is calculated forexample by the following:

$\mspace{20mu} {V_{Exp} = \frac{\text{?}\left( {y_{i} - B} \right)}{SR}}$?indicates text missing or illegible when filed

where N_(Exp) is the number of expiration points i in the curve, y_(i)and B are the signal amplitude and the baseline, respectively. SR is thesampling rate of the signal in samples per minute.

In an embodiment, the volume related measurement includes a function ofinspiration volume and expiration volume. An example is a ratio betweeninspiration volume and expiration volume.

FIG. 9 shows an example of feature extraction that in an embodiment isperformed by the feature extractor 310 of FIG. 3. A window 900 comprisesa plurality of breath signals within a respiratory flow signal. Window900 is shown centred on breath B indicated at 902.

In an embodiment the window is of size N so that it includes Nconsecutive breaths immediately following breath B in the respiratoryflow signal, and includes N consecutive breaths immediately precedingbreath B in the respiratory flow signal. The boundaries of window 900are defined so as to include breath_(+N) indicated at 904, andbreath_(−N) indicated at 906.

In an embodiment the value of N is 15. In an embodiment the value of Nis selected from a range of 2 to 30.

In an embodiment the window 900 is further subdivided into at least onefurther window, for example window 908 and window 910. In an embodimentwindow 908 is ⅔ the size of window 900. In an embodiment window 910 is ⅓the size of window 900.

In an embodiment, window 908 and/or window 910 has/have boundariesdefined so as to include breath B and breath_(+N) but not breath_(−N).In an embodiment, window 908 and/or window 910 has/have boundariesdefined so as to include breath B and breath_(−N) but not breath_(+N).In an embodiment, window 908 and/or window 910 has/have boundariesdefined so as to include breath B but not breath_(+N) and notbreath_(−N).

One example of a respiratory feature obtained from at least part of therespiratory flow signal is a mean breath measurement associated to atleast some of the breaths in the respiratory flow signal.

In an embodiment the respiratory features obtained from the respiratoryflow signal represent a mean breath measurement associated to thebreaths within one or more of window 900, window 908, window 910.

Another example of a respiratory feature obtained from at least part ofthe respiratory flow signal is a standard deviation of breathmeasurements associated to at least some of the breaths in therespiratory flow signal.

In an embodiment the respiratory features obtained from the respiratoryflow signal represent a standard deviation of breath measurementsassociated to the breaths within one or more of window 900, window 908,window 910.

In an embodiment the breath measurements include one or more of durationmeasurements, amplitude measurements, centre of mass relatedmeasurements, derivative related measurements, volume relatedmeasurements.

In an embodiment the breath features describe the morphology of part ofthe respiratory flow signal that surrounds a breath B under evaluation.In an embodiment the mean and/or standard deviation for up to 26 breathmeasurements are determined for one or more of windows 900, 908, 910.This results in a total of up to 156 respiratory features.

In an embodiment, a mapping is performed by the mapping module 312 ofFIG. 3. The mapping module 312 is configured to map a given set ofrespiratory features to a sleep stage.

In an embodiment the mapping module 312 applies a supervised learningalgorithm. Suitable algorithms include one or more of linear andlogistic regression, support vector machine, artificial neural network,decision tree. In an embodiment, the learning is performed offline withpreviously recorded and labelled data.

In an embodiment the mapping module 312 applies an unsupervised learningalgorithm. In an embodiment the mapping module 312 applies asemi-supervised learning algorithm.

In an embodiment, machine learning methods that provide such learningcapabilities are used to improve accuracy of the module 300. In anembodiment, learning is carried out to suit the conditions of individualpatients. For instance, parts of the signal where strong markers arepresent, for example start of the night or periods prior to events, canbe used to adapt the model to specific patient profiles.

In an embodiment the mapping module 312 maps a set of respiratoryfeatures to a sleep stage selected from awake, N1, N2, N3, REM. In anembodiment the sleep stage is selected from awake, light sleep, deepsleep, REM. In an embodiment the sleep stage is selected from awake,non-REM, REM. In an embodiment the sleep stage is selected from awake,sleep.

In an embodiment the features are calculated on a breath basis. In thiscase the module 300 provides breath-basis output. The breath outputs arethen combined in 30 second epochs to calculate agreement to a correcthypnogram determined by mapping module 312. The resultant epoch outputfor each class is calculated as the average of breaths output. Theresultant epoch output is then normalized so that the sum of the outputsfor all classes are 1.

In an embodiment a context module 314 is configured to apply contextualclues in an attempt to improve accuracy of the mapping module 312.

One example of a contextual clue is identification of periods withoutbreathing. It can be assumed that a user is awake after long periods inwhich the absence of a respiratory flow signal is detected. This occursin the beginning of the session and when the user takes the mask offduring the night. An example threshold is 7 minutes. After thisthreshold period of no respiratory flow signal it is assumed the user isawake and a sleep stage of awake is determined.

Another example of a contextual clue is identification of SleepDisordered Breathing (SDB) events. It is assumed that prior to thedetection of SDB events, the user is asleep. Prior to SDB events, asleep stage of sleep is set. This could be light, deep, or REM. In anembodiment a threshold window of 10 epochs (5 minutes) prior to an SDBevent is used.

Another example of a contextual clue is neighbouring consensus. It isassumed that individual epochs with differing labels compared to theirneighbouring epochs are wrongly detected. One aim is to remove sleepstages that are likely to have been wrongly detected, by analysing thecontext where they are placed.

In an embodiment, the modelling of sleep stages is performed usingalgorithms that learn temporal structures at different scales. HiddenMarkov Models (HMM) and its state machine representation and TemporalDelay Neural Networks (TDNN) are examples of learning methods that canbe used. In an embodiment, HMM is applied in an attempt to learn thesleep stage transition probabilities using several bio-signals. In anembodiment, ‘a priori’ probability is implemented to captureprobabilities of observing a particular state at different periods ofthe night.

In an embodiment, the module 300 implements a sleep score. The sleepscore attempts to capture, in at least one index, sleep quality andeffectiveness. In an embodiment, multiple indices are used.

There is no clear consensus about the best metrics to capture quality ofsleep. One reason for this is that the requirements for having a goodnight of sleep can vary from person to person, due to age, externalfactors, etc. Some metrics have been proposed, each one capturing thesleep condition in different ways. Some of these metrics are:

-   -   Sleep efficiency—Sleep efficiency is defined as Total Sleep        time/Total time in bed. It captures the amount of time        effectively sleeping while in bed.    -   Deep sleep time—Periods of deep sleep are when the body relaxes        and are usually associated with body and muscular recovery        (physical restoration).    -   REM time—Period of REM time are usually associated memory and        learning consolidation.    -   Sleep fragmentation—Can be defined in different ways, but        essentially tries to capture the number of times arousals/awakes        occur during the night. Highly fragmented sleep is usually        associated with poor sleep and difficulty to remain in deep        sleep or REM stage for long periods.

A good night of sleep should ideally have long periods of deep sleep andREM stages and low sleep fragmentation.

In an embodiment the module 300, or a further module taking input frommodule 300, calculates one or more of the indices Sleep time (ST), TotalTime at Deep Sleep (DST), Total Time at REM (REMT), Number of SleepDisruptions (number of awakes during the night after sleep onset) (NSD),Number of SDB events (NSDB).

In an embodiment the indices are combined as:

X1*ST+X2*DST+X3*REMT+X4*NSD+X5*NSDB

where:ST score changes linearly [0 for 0 hours, 100 for 7 hours or more]DST score changes linearly [0 for 0 hours, 100 for 1.5 hours or more]REMT score changes linearly [0 for 0 hours, 100 for 1.5 hours or more)NSD score changes linearly [100 for 0, 0 for 10 or more disruptions]NSDB score changes linearly [100 for 0, 0 for 10 or more events/hour].

Setting X1 to X5 to 0.2, equal weight is given to each score and theresultant sleep score is in the range [0, 1].

Experimental results are described with reference to FIGS. 10-13.Described below is an evaluation of the performance of a system todetermine partial sleep staging from the respiratory flow signal alone.In particular, described is the performance of models automaticallygenerated based on flow patterns.

A dataset composed of 50 studies, with full PSG recordings, is used inthe experiments. All patients in the study use a modular assistedbreathing unit and humidifier system 102 at fixed pressure or pressureauto adjustment mode.

In total, more than 370000 breaths were detected using a breath detectoralgorithm. To speed up the process of training and testing, half of thesamples were used (every second sample). From the remaining 187806samples, at most 400 samples from each patient were used for training(100 samples from each class), resulting in a training pool of 19607breaths. The number of training samples is lower than 50×400=20000because 100 samples of each class were not available in all patients.The test pool was composed of the 168199 samples.

Five-folds cross-validation technique was used for error estimation,where the folds were stratified by patient, i.e., each fold is composedof samples from 10 patients.

During the training procedure, a cost learning matrix was used to givedifferent costs for each error as:

Awake Light Sleep Deep Sleep REM Awake 0 5 5 10 Light Sleep 5 0 5 5 DeepSleep 5 5 0 5 REM 10 5 5 0

The use of the cost learning matrix aims at reducing errors betweenspecific classes. The aim is to direct the learning procedure topenalise the misclassification between Awake and REM.

Once the training is done and the model is inferred, the operating pointis chosen targeting equal TP Rate for all classes. The results of thecross-validated test sets have been used to find the equal TP Rateoperating points. Having equal TP Rate in all classes implies thatsimilar numbers of samples are allocated to each class when compared tothe results of the mapping module 312.

The best result was obtained with the Random Forest algorithm. In thealgorithm 100 decision trees were created and the final classificationobtained by combining the results of each tree. The following tableshows the resultant confusion matrix. The overall Accuracy was 0.559.

Confusion matrix TP Rate Precision 3227 2192 288 172 Awake 0.549 0.5991749 13620 6170 2288 Light Sleep 0.571 0.643 223 3381 4707 657 DeepSleep 0.524 0.402 188 1964 541 3574 REM 0.570 0.534

FIG. 10 shows an example of agreement between the mapping module 312 andthe inferred sleep stages on a test study.

FIG. 11 shows an application of the context module 314 to improve theaccuracy of the mapping module 312.

It can be assumed that individual epochs with differing labels comparedto their neighbouring epochs are wrongly detected. This aims at removingstates that are likely to have been wrongly detected, by analysing thecontext where they are placed.

Using majority voting over neighbouring windows, for example recursivelyuntil no more changes occur, has the potential to replace extremelyshort-term stages with neighbouring labels. The number of neighbouringepochs N used for majority voting was set to 7.

By using contextual cues the resultant accuracy increases to 0.602,shown as the confusion matrix in the following table.

TP F- Confusion matrix Rate Precision measure 3135 2383 197 124 Awake0.537 0.663 0.593 1245 15180 5847 1548 Light Sleep 0.637 0.658 0.648 2073434 4968 359 Deep Sleep 0.554 0.437 0.489 145 2067 321 3731 REM 0.5960.648 0.620

FIG. 12 shows the accuracy per patient as having a range varying between[0.31, 0.83], mean=0.6 with 95% confidence that the mean is between[0.57, 0.63].

FIG. 13 shows an example of typical performance for an individualpatient with agreement of 61.4%.

FIG. 14 shows an example of a system representative of a computingsystem and/or device that implements module 300 from FIG. 3. Thecomputing device 1400 comprises one or more of a server of a serviceprovider, a device associated with the client (for example a clientdevice), an on-chip system, any other suitable computing device orcomputing system.

In an embodiment, computing device 1400 includes a processing system1402, one or more computer-readable media 1404, and one or moreInput/Output (I/O) Interfaces 1406 that are communicatively coupled, oneto another. In an embodiment the computing device 1400 further includesa system bus or other data and command transfer system (not shown) thatcouples the various components, one to another. A system bus includesone or more of a memory bus or memory controller, a peripheral bus, auniversal serial bus, a processor or local bus that utilizes any of avariety of bus architectures.

The processing system 1402 is representative of functionality to performone or more operations using hardware. Accordingly, the processingsystem 1402 is illustrated as including hardware element(s) 1408configured as one or more of processors and/or functional blocks. Thismay include implementation in hardware as an application specificintegrated circuit or other logic device formed using one or moresemiconductors. The hardware elements 1408 are not limited by thematerials from which they are formed or the processing mechanismsemployed therein. For example, processors may be comprised ofsemiconductor(s) and/or transistors (e.g., electronic integratedcircuits (ICs)). In such a context, processor-executable instructionsmay be electronically-executable instructions

The computer-readable media 1404 is illustrated as includingmemory/storage 1410. The memory/storage 1410 represents memory/storagecapacity associated with one or more computer-readable media. In anembodiment the memory/storage 1410 includes one or more of volatilemedia (such as random access memory (RAM)), nonvolatile media (such asread only memory (ROM), Flash memory, optical disks, magnetic disks.

In an embodiment the memory/storage 1410 includes one or more of fixedmedia (e.g., RAM, ROM, a fixed hard drive), removable media (e.g., Flashmemory, a removable hard drive, an optical disc).

Input/output interface(s) 1406 are representative of functionality toallow a user to enter commands and information to computing device 1400,and also allow information to be presented to the user and/or othercomponents or devices using various input/output devices.

Examples of input devices include a keyboard, a cursor control device(e.g., a mouse), a microphone (e.g., for voice recognition and/or spokeninput), a scanner, touch functionality (e.g., capacitive or othersensors that are configured to detect physical touch), a camera (e.g.,which may employ visible or non-visible wavelengths such as infraredfrequencies to detect movement that does not involve touch as gestures),and so forth.

Examples of output devices include a display device (e.g., a monitor orprojector), speakers, a printer, a network card, tactile-responsedevice, and so forth.

Various techniques are described herein in the general context ofsoftware, hardware elements, or program modules. Generally, such modulesinclude routines, programs, objects, elements, components, datastructures, and so forth that perform particular tasks or implementparticular abstract data types. The terms ‘module’, ‘functionality’, and‘component’ as used herein generally represent software, firmware,hardware, or a combination thereof. The features of the techniquesdescribed herein are platform-independent, meaning that the techniquesmay be implemented on a variety of commercial computing platforms havinga variety of processors.

In an embodiment, an implementation of the described modules andtechniques is stored on or transmitted across some form ofcomputer-readable media. The computer-readable media includes a varietyof media that may be accessed by the computing device 1400.

Hardware elements 1408 and computer-readable media 1404 arerepresentative of instructions, modules, programmable device logicand/or fixed device logic implemented in a hardware form that may beemployed in some embodiments to implement at least some aspects of thetechniques described herein.

In an embodiment, hardware elements include one or more of components ofan integrated circuit or on-chip system, an application-specificintegrated circuit (ASIC), a field-programmable gate array (FPGA), acomplex programmable logic device (CPLD). In an embodiment, a hardwareelement operates as a processing device that performs program tasksdefined by instructions, modules, and/or logic embodied by the hardwareelement as well as a hardware device utilized to store instructions forexecution, for example computer-readable storage media.

In an embodiment, software, hardware, or program modules and otherprogram modules are implemented as one or more instructions and/or logicembodied on some form of computer-readable storage media and/or by oneor more hardware elements 1408. The computing device 1400 is configuredto implement particular instructions and/or functions corresponding tothe software and/or hardware modules. Accordingly, implementation ofmodules that are executable by the computing device 1400 as software maybe achieved at least partially in hardware, e.g., through use ofcomputer-readable storage media and/or hardware elements 1408 of theprocessing system.

In an embodiment the instructions and/or functions areexecutable/operable by one or more computing devices 1400 and/orprocessing systems 1402 to implement techniques, modules, and examplesdescribed herein.

In an embodiment the computing device 1400 comprises a device selectedfrom a computer class of devices that includes personal computers,desktop computers, multi-screen computers, laptop computers, netbooks.In an embodiment the computing device 1400 comprises a device selectedfrom a mobile class of devices that includes mobile phones, tabletcomputers, multi-screen computers, wearable devices.

In an embodiment the module 300 and related components is implemented atleast partly through use of a distributed system over a cloud 1412 via aplatform 1414 for resources 1416. The platform 1414 abstracts underlyingfunctionality of hardware, for example servers, and software resourcesof the cloud 1412.

In an embodiment the resources 1416 include applications and/or datathat are used while computer processing is executed on servers that areremote from the computing device 1400. In an embodiment, resources 1416include services provided over the Internet and/or through a subscribernetwork, such as a cellular or Wi-Fi network.

In an embodiment, platform 1414 abstracts resources and functions toconnect the computing device 1400 with other computing devices. In anembodiment the platform 1414 serves to abstract scaling of resources toprovide a corresponding level of scale to encountered demand for theresources 1416 that are implemented via the platform 1414.

In an interconnected device embodiment, implementation of functionalitydescribed herein tends to be distributed. For example, in an embodiment,the functionality is implemented in part on the computing device 1400 aswell as via the platform 1414 that abstracts the functionality of thecloud 1412.

The foregoing description of the invention includes preferred formsthereof. Modifications may be made thereto without departing from thescope of the invention, as defined by the accompanying claims.

1. A method of determining a sleep stage of a user, comprising:receiving a respiratory flow signal of a user; obtaining at least onerespiratory feature from at least part of the respiratory flow signal;and determining a sleep stage from the at least one respiratory feature.2. The method of claim 1 wherein the at least one respiratory feature isbased at least partly on at least one duration measurement.
 3. Themethod of claim 2 wherein the at least one duration measurement includesone or more of breath duration, inspiration duration, maximuminspiration time, maximum expiration time, a function of maximumexpiration time and maximum inspiration time, a function of inspirationduration and breath duration.
 4. The method of claim 1 wherein the atleast one respiratory feature is based at least partly on at least oneamplitude measurement.
 5. The method of claim 4 wherein the at least oneamplitude measurement includes one or more of maximum inspirationamplitude, maximum expiration amplitude, a function of maximuminspiration amplitude and maximum expiration amplitude.
 6. The method ofclaim 1 wherein the at least one respiratory feature is based at leastpartly on at least one centre of mass related measurement.
 7. The methodof claim 6 wherein the at least one centre of mass related measurementincludes one or more of inspiration centre of mass time, inspirationcentre of mass amplitude, expiration centre of mass time, expirationcentre of mass amplitude, a function of expiration centre of mass timeand inspiration centre of mass time, a function of expiration centre ofmass amplitude and inspiration centre of mass amplitude.
 8. The methodof claim 1 wherein the at least one respiratory feature is based atleast partly on at least one derivative related measurement.
 9. Themethod of claim 8 wherein the at least one derivative relatedmeasurement includes one or more of maximum negative acceleration time,maximum negative acceleration amplitude, maximum positive accelerationtime, maximum positive acceleration amplitude, maximum negative flowrate time, maximum negative flow rate amplitude, maximum inspirationacceleration time, maximum inspiration acceleration amplitude.
 10. Themethod of claim 1 wherein the at least one respiratory feature is basedat least partly on at least one volume related measurement.
 11. Themethod of claim 10 wherein the at least one volume related measurementincludes one or more of inspiration volume, expiration volume, afunction of inspiration volume and expiration volume.
 12. The method ofclaim 1 further comprising: identifying, within the respiratory flowsignal, at least one breath signal representing a breath of the user;and obtaining at least one breath measurement from a portion of therespiratory flow signal within which the at least one breath signal isidentified.
 13. The method of claim 12 further comprising: identifying,within the respiratory flow signal, a window containing a plurality ofbreath signals; and obtaining respective breath measurements of thebreath signals within the window.
 14. The method of claim 13 wherein theat least one breath feature comprises a mean and/or standard deviationof the breath measurements within at least part of the window.
 15. Themethod of claim 1 further comprising determining a sleep stage from theat least one breath feature at least partly by applying at least one ofa supervised learning algorithm, an unsupervised learning algorithm, asemi-supervised learning algorithm.
 16. The method of claim 1 whereinthe sleep stage comprises one of awake, N1, N2, N3, REM.
 17. A sleepdetermination system comprising: a feature extractor configured toobtain at least one respiratory feature from at least part of arespiratory flow signal of a user; and a mapping module configured todetermine a sleep stage from the at least one respiratory feature.
 18. Asleep determination system comprising: a processor; and a computerreadable medium having stored thereon computer executable instructionsthat, when executed by the processor, cause the processor to perform amethod of determining a sleep stage of a user, the method comprising:receiving a respiratory flow signal of a user; obtaining at least onerespiratory feature from at least part of the respiratory flow signal;and determining a sleep stage from the at least one respiratory feature.19. A computer readable medium having stored thereon computer-executableinstructions that, when executed by a processor, cause the processor toperform a method of determining a sleep stage of a user, the methodcomprising: receiving a respiratory flow signal of a user; obtaining atleast one respiratory feature from at least part of the respiratory flowsignal; and determining a sleep stage from the at least one respiratoryfeature.